package cn.web.management.web.servlet.inform.admin;


import cn.web.management.service.general.AdminUpdate;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "updatePersonalInformServlet", value = "/updatePersonalInformServlet")
public class updatePersonalInformServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    /**
     * @description: 更新用户信息
     * @paramName: [req, resp]
     * @paramType: [javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse]
     * @returnType: void
     */
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String employno = req.getParameter("employno");
        String field = req.getParameter("field");
        String value = req.getParameter("value");

        AdminUpdate adminUpdate = new AdminUpdate();
        boolean b = adminUpdate.updatePersonalInform(employno, field, value);
        resp.getWriter().write(b+"");
    }
}
